github.com/kubeshop/testkube@v1.17.23/test/postman/Variables test.postman_collection.json (about) 1 { 2 "info": { 3 "_postman_id": "7c98d039-2401-4d12-85c4-11980b829a23", 4 "name": "Variables test", 5 "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" 6 }, 7 "item": [ 8 { 9 "name": "Homepage healthcheck", 10 "event": [ 11 { 12 "listen": "test", 13 "script": { 14 "exec": [ 15 "pm.test(\"Environment variables are set\", function () {", 16 " pm.expect(pm.environment.get(\"var1\"), \"var1 should be equal to val1\").eq(\"val1\");", 17 " pm.expect(pm.environment.get(\"sec1\"), \"sec1 should be equal to pass1\").eq(\"pass1\")", 18 "});", 19 "" 20 ], 21 "type": "text/javascript" 22 } 23 }, 24 { 25 "listen": "prerequest", 26 "script": { 27 "exec": [ 28 "console.log(\"VAR var1\", pm.environment.get(\"var1\"));", 29 "console.log(\"VAR sec1\", pm.environment.get(\"sec1\"));" 30 ], 31 "type": "text/javascript" 32 } 33 } 34 ], 35 "request": { 36 "method": "GET", 37 "header": [], 38 "url": { 39 "raw": "https://wysocki.consulting/", 40 "protocol": "https", 41 "host": [ 42 "wysocki", 43 "consulting" 44 ], 45 "path": [ 46 "" 47 ] 48 } 49 }, 50 "response": [] 51 } 52 ], 53 "event": [ 54 { 55 "listen": "prerequest", 56 "script": { 57 "type": "text/javascript", 58 "exec": [ 59 "" 60 ] 61 } 62 }, 63 { 64 "listen": "test", 65 "script": { 66 "type": "text/javascript", 67 "exec": [ 68 "" 69 ] 70 } 71 } 72 ], 73 "variable": [ 74 { 75 "key": "env1", 76 "value": "val1", 77 "type": "string" 78 }, 79 { 80 "key": "env2", 81 "value": "val2", 82 "type": "string" 83 } 84 ] 85 }